import "https://cdn.bootcdn.net/ajax/libs/jquery/1.12.4/jquery.min.js"; //引入第三方的类库
//轮播图
function Carousel() {
    var oPic = document.getElementById('pic');
    var oImg = oPic.getElementsByTagName('img');
    var oLeft = document.getElementById('left');
    var oRight = document.getElementById('right');
    var oList = document.getElementById('list');
    var Item = oList.getElementsByTagName('li');
    var num = 0;
    Item[0].style.backgroundColor = 'blue';
    oImg[0].style.display = 'block';
    oRight.onclick = function() {
        oImg[num].style.display = 'none';
        Item[num].style.backgroundColor = '#999999';
        num++;
        if (num >= 6) {
            num = 0;
        }
        oImg[num].style.display = 'block';
        Item[num].style.backgroundColor = 'blue';

    }
    oLeft.onclick = function() {
        oImg[num].style.display = 'none';
        Item[num].style.backgroundColor = '#999999';
        num--;
        if (num <= -1) {
            num = 5;
        }
        oImg[num].style.display = 'block';
        Item[num].style.backgroundColor = 'blue';
    }
}
export {
    Carousel
}